function SrvHost(params){ 
	 
}

SrvHost.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvHost.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvHost.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvHost.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.shId=function(shId){if(this.proxy)return this.getProxy().shId(shId);  this.put("shId", shId);return this;};
	/** and sh_id is null */
	this.shIdNull=function(){if(this.proxy)return this.getProxy().shIdNull();if(this.get("shIdNot")==null)this.put("shIdNot", "");this.put("shId", null);return this;};
	/** not .... */
	this.shIdNot=function(){if(this.proxy)return this.getProxy().shIdNot();this.put("shIdNot", "not");return this;};
	this.shIdNotNull=function(){if(this.proxy)return this.getProxy().shIdNotNull();this.put("shIdNot", "not");this.put("shId", null);return this;};
	this.shIdNot=function(shId){if(this.proxy)return this.getProxy().shIdNot(shId);this.put("shIdNot", "not");this.put("shId", shId);return this;};
		
	/** and sh_id <= ? */
	this.shIdMin=function(min){if(this.proxy)return this.getProxy().shIdMin(min);this.put("shIdMin", min);return this;};
	/** and sh_id >= ? */
	this.shIdMax=function(max){if(this.proxy)return this.getProxy().shIdMax(max);this.put("shIdMax", max);return this;};
		
		
	this.shIdIn=function(ids){
		if(this.proxy)return this.getProxy().shIdIn(ids);  this.put("shIdIn", ids);return this;
	};	
		 
	
	
	/** 商户名称 [非空]       **/
	this.shName=function(shName){if(this.proxy)return this.getProxy().shName(shName);  this.put("shName", shName);return this;};
	/** and sh_name is null */
	this.shNameNull=function(){if(this.proxy)return this.getProxy().shNameNull();if(this.get("shNameNot")==null)this.put("shNameNot", "");this.put("shName", null);return this;};
	/** not .... */
	this.shNameNot=function(){if(this.proxy)return this.getProxy().shNameNot();this.put("shNameNot", "not");return this;};
	this.shNameNotNull=function(){if(this.proxy)return this.getProxy().shNameNotNull();this.put("shNameNot", "not");this.put("shName", null);return this;};
	this.shNameNot=function(shName){if(this.proxy)return this.getProxy().shNameNot(shName);this.put("shNameNot", "not");this.put("shName", shName);return this;};
		
		 
	
	
	/** 标识        **/
	this.shFlag=function(shFlag){if(this.proxy)return this.getProxy().shFlag(shFlag);  this.put("shFlag", shFlag);return this;};
	/** and sh_flag is null */
	this.shFlagNull=function(){if(this.proxy)return this.getProxy().shFlagNull();if(this.get("shFlagNot")==null)this.put("shFlagNot", "");this.put("shFlag", null);return this;};
	/** not .... */
	this.shFlagNot=function(){if(this.proxy)return this.getProxy().shFlagNot();this.put("shFlagNot", "not");return this;};
	this.shFlagNotNull=function(){if(this.proxy)return this.getProxy().shFlagNotNull();this.put("shFlagNot", "not");this.put("shFlag", null);return this;};
	this.shFlagNot=function(shFlag){if(this.proxy)return this.getProxy().shFlagNot(shFlag);this.put("shFlagNot", "not");this.put("shFlag", shFlag);return this;};
		
		 
	
	
	/** 负责人 [非空]       **/
	this.shMaster=function(shMaster){if(this.proxy)return this.getProxy().shMaster(shMaster);  this.put("shMaster", shMaster);return this;};
	/** and sh_master is null */
	this.shMasterNull=function(){if(this.proxy)return this.getProxy().shMasterNull();if(this.get("shMasterNot")==null)this.put("shMasterNot", "");this.put("shMaster", null);return this;};
	/** not .... */
	this.shMasterNot=function(){if(this.proxy)return this.getProxy().shMasterNot();this.put("shMasterNot", "not");return this;};
	this.shMasterNotNull=function(){if(this.proxy)return this.getProxy().shMasterNotNull();this.put("shMasterNot", "not");this.put("shMaster", null);return this;};
	this.shMasterNot=function(shMaster){if(this.proxy)return this.getProxy().shMasterNot(shMaster);this.put("shMasterNot", "not");this.put("shMaster", shMaster);return this;};
		
		 
	
	
	/** 公司名称 [非空]       **/
	this.shCompany=function(shCompany){if(this.proxy)return this.getProxy().shCompany(shCompany);  this.put("shCompany", shCompany);return this;};
	/** and sh_company is null */
	this.shCompanyNull=function(){if(this.proxy)return this.getProxy().shCompanyNull();if(this.get("shCompanyNot")==null)this.put("shCompanyNot", "");this.put("shCompany", null);return this;};
	/** not .... */
	this.shCompanyNot=function(){if(this.proxy)return this.getProxy().shCompanyNot();this.put("shCompanyNot", "not");return this;};
	this.shCompanyNotNull=function(){if(this.proxy)return this.getProxy().shCompanyNotNull();this.put("shCompanyNot", "not");this.put("shCompany", null);return this;};
	this.shCompanyNot=function(shCompany){if(this.proxy)return this.getProxy().shCompanyNot(shCompany);this.put("shCompanyNot", "not");this.put("shCompany", shCompany);return this;};
		
		 
	
	
	/** 描述 [非空]       **/
	this.shDesc=function(shDesc){if(this.proxy)return this.getProxy().shDesc(shDesc);  this.put("shDesc", shDesc);return this;};
	/** and sh_desc is null */
	this.shDescNull=function(){if(this.proxy)return this.getProxy().shDescNull();if(this.get("shDescNot")==null)this.put("shDescNot", "");this.put("shDesc", null);return this;};
	/** not .... */
	this.shDescNot=function(){if(this.proxy)return this.getProxy().shDescNot();this.put("shDescNot", "not");return this;};
	this.shDescNotNull=function(){if(this.proxy)return this.getProxy().shDescNotNull();this.put("shDescNot", "not");this.put("shDesc", null);return this;};
	this.shDescNot=function(shDesc){if(this.proxy)return this.getProxy().shDescNot(shDesc);this.put("shDescNot", "not");this.put("shDesc", shDesc);return this;};
		
		 
	
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.shStatus=function(shStatus){if(this.proxy)return this.getProxy().shStatus(shStatus);  this.put("shStatus", shStatus);return this;};
	/** and sh_status is null */
	this.shStatusNull=function(){if(this.proxy)return this.getProxy().shStatusNull();if(this.get("shStatusNot")==null)this.put("shStatusNot", "");this.put("shStatus", null);return this;};
	/** not .... */
	this.shStatusNot=function(){if(this.proxy)return this.getProxy().shStatusNot();this.put("shStatusNot", "not");return this;};
	this.shStatusNotNull=function(){if(this.proxy)return this.getProxy().shStatusNotNull();this.put("shStatusNot", "not");this.put("shStatus", null);return this;};
	this.shStatusNot=function(shStatus){if(this.proxy)return this.getProxy().shStatusNot(shStatus);this.put("shStatusNot", "not");this.put("shStatus", shStatus);return this;};
		
		
	this.shStatusIn=function(ids){
		if(this.proxy)return this.getProxy().shStatusIn(ids);  this.put("shStatusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有授权商户 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/permissions/host.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取授权商户分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/permissions/host.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取授权商户 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/permissions/host.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvHost.get = function(id){
	var protocol = ux.ajax("/admin/permissions/host.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvHost;
	return null;
}

SrvHost.where = new SrvHost.Where(0,true);